﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class Pages_beschikbareRoutes : System.Web.UI.Page
{
    algemeen alg = new algemeen();
    protected void Page_Load(object sender, EventArgs e)
    {
        string sql_query = "SELECT transport_id , naam FROM transport ORDER BY naam ASC";
        SqlConnection connection = new SqlConnection(alg.sql_string);
                                                            
   
        
        using (SqlCommand command = new SqlCommand(sql_query, connection))
        {
            connection.Open();
            this.Label1.Text = "<h1>Rij routes</h1><ul>";
            SqlDataReader objDataReader = command.ExecuteReader();
            //if(objDataReader.Read())

            while (objDataReader.Read())
            {
                this.Label1.Text += "<li><A href=\"routeMap.aspx?query="+objDataReader.GetInt32(0).ToString()+"\">"+objDataReader.GetString(1)+"</a></li>";
            }
            this.Label1.Text += "</ul>";
            connection.Close();
        }
    }
    
}
